<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/index/text4.css" />
		<style>
		</style>
	</head>

	<body>
		<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
			<div class="mui-content">
			  <div class="mui-row box-top" id="reback">
			        <div class="mui-col-sm-6 mui-col-xs-12 title-box">
			            <i class="mui-icon mui-icon-back"></i>
			        </div>
			        <div class="mui-col-sm-6 mui-col-xs-12">
			        </div>
			    </div>
			</div>
			<!--  -->
			<div id="gps-show">
				<input type="text" id="informat" placeholder="请输入推送的消息"/>
			</div>
			<div class="caremam-btn-con">
				<div class="mui-row box-top" id="reback">
			        <div class="mui-col-sm-12 mui-col-xs-12">
			            <button type="button" class="mui-btn mui-btn-success" id="blool">消息推送</button>
			        </div>
			        <!--<div class="mui-col-sm-6 mui-col-xs-6">
			            <button type="button" class="mui-btn mui-btn-success" id="blools">获取消息</button>
			        </div>-->
			 	</div>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script>
		mui.init();
		document.getElementById('reback').addEventListener('tap', function() {
				mui.back()
		})
		
        document.getElementById('blool').addEventListener('tap', function () {
        	var inpus = document.getElementById('informat').value 

        	if (!inpus) {
        		return	mui.alert('请输入推送的消息', '提示', ['确定'], null, 'div')
        	}
        	plus.push.createMessage( inpus, inpus )
        })
       
       
		document.addEventListener( "plusready", function(){
		    message = document.getElementById("blools");
		    // 监听点击消息事件
		    plus.push.addEventListener( "click", function( msg ) {
		        // 判断是从本地创建还是离线推送的消息
		        switch( msg.payload ) {
		            case "LocalMSG":
		                console.log(JSON.stringify(msg), 12120)
		            break;
		            default:
		                console.log(JSON.stringify(msg), 3535)
		            break;
		        }
		        // 提示点击的内容
		       	mui.alert(msg.content, '您点击的提示消息', ['确定'], null, 'div')
		    }, false );

		}, false );

	</script>
</html>